<template>
   <div>
       <DataTotal :total="total" :types="types" :name="'domestic'" @showmore="showMoreData"></DataTotal>
       <DataTable :data="data" :title="'国内各省'"></DataTable>
   </div>
</template>

<script>
import DataTotal from '../componets/dataTotal';
import DataTable from '../componets/dataTable';

export default {
    components:{
        DataTotal,
        DataTable
    },
    props:['total','data'],
    data(){
        return{
            types:['confirm','nowConfirm','imported','heal']
        }
    },
    methods:{
        showMoreData(name){
            const addItem = name === 'abroad' ? ['imported','suspect'] : ['dead','suspect']
            this.types =this.types.concat(addItem);
        }
    }
}
</script>

<style>

</style>